$(function () {

    $(".saveSjxxBtn").click(function(){
    	vm.saveSjxx();
	});

    $(".copySjxx").click(function(){
        vm.copySjxx();
    });

    $("#sjmcCx").click(function(){
        vm.getSjxxList();
    });

    $(".selectSJxxbtn2").click(function(){

        swiper.slideTo(4, 2000, false);//切换到第一个slide，速度为1秒
    });

    $(".saveSt_option").click(function(){
        vm.saveSjtitle();
    });

    $(".createKSXX").click(function(){
        vm.saveKsxx();
    });

    $(".fdck").click(function(){
        window.open($("#sjyl").attr("src"));
    })

    setTimeout(function(){

        vm.getSjxxList();
	},1000);

    var local = window.location.host;

     $(".selectSJxxbtn2").click(function(){
         $("#sjyl").attr("src","http://"+local+ '/modules/test/examPreview.html?testId='+vm.jySjInfo.id);
         vm.getSJTitle(vm.jySjInfo.id);
     });
    $(".selectSJxxbtn").click(function(){
        var vid = $(".sjList.active > .vid").text();
        vm.sjId = vid; //保存试卷ID
        // alert(vm.sjId);
        var url = "jysjinfo/info/"+vid;
        $.ajax({
            type: "POST",
            url: baseURL + url,
            contentType: "application/json",
            // data: JSON.stringify(vm.jySjOptions2),
            success: function(r){
                if(r.code === 0){
                    //console.log(r);
                   vm.jySjInfo = r.jySjInfo ;

                   var k = new Date();
                   var n = k.getFullYear();
                   var y = k.getMonth() + 1+"";
                   y = y.length == 1 ?"0"+y:y;
                   var d = k.getDate()+"";
                    d = d.length == 1 ?"0"+d:d;
                   var x = k.getHours()+"";
                    x = x.length == 1 ?"0"+x:x;
                   var f = k.getMinutes()+"";
                    f = f.length == 1 ?"0"+f:f;

                   vm.jySjInfo.examStartTime = vm.jySjInfo.examStartTime || n + "-"+y+"-"+d+" "+x+":"+f+"";
                      vm.jySjInfo.examEndTime = vm.jySjInfo.examEndTime || n + "-"+y+"-"+d+" "+x+":"+f+"";
                      vm.jySjInfo.examAheadTime = vm.jySjInfo.examAheadTime || 60;
                    vm.jySjInfo.markEchelon = vm.jySjInfo.markEchelon || "0-60-80-90-100";
                    vm.jySjInfo.fullMark =  vm.jySjInfo.fullMark || 100;

                   $("#sjyl").attr("src","http://"+local+ '/modules/test/examPreview.html?testId='+vm.jySjInfo.id);
                   vm.getSJTitle(vm.jySjInfo.id);
                }else{
                    alert(r.msg);
                }
            }
        });
        vm.getStTile(); //取得试题信息
        swiper.slideTo(1, 2000, false);//切换到第一个slide，速度为1秒
        $(".step1 *").prop("disabled",true);
    });

    // //修改选择项
    // $(".st_key input[type=radio] ").change(function(){
    //         $(".st_da_true").text($(this).parent().parent().find(".optionName").val());
    //        var i = parseInt($(this).parent().parent().find(".st_key").text(),10);
    //     vm.jySjOptions1.forEach(function(it,index){
    //         it.isStandard = false;
    //         Vue.set(vm.jySjOptions1, index,  it);
    //        })
    //         vm.jySjOptions1[i].isStandard = true;
    //     Vue.set(vm.jySjOptions1, i, vm.jySjOptions1[i]);
    // });


    vm.getKcxx();

});


var vm = new Vue({
    el:'#root',
    data:{
        sjmcQuery:"",
        sjId:"", //试卷ID
        stCont:0,//试题 总数
        stFsCont:0,//试题分数总数
        jyKcxxList:[

        ],
        sjtitleList:[], //试题列表
        jySjInfo: {
            id:"",
            name:"", //名称
            sjDescribe:"",//介绍
            // bz:"", //备注
            // lb:"",//类别
            // khfs:"",//考核方式
            examStartTime:"",
            examEndTime:"",
            kcId:"1",
            markEchelon:"0-60-80-90-100",
            examAheadTime:60,
            fullMark:100,
            status:0//状态 默认为非发布状态
        },
        jySjTitle:{ //试题
            infoId:"",
            title:"单选题1",//题目
            type:1,//类型
            sjDescribe:"单选题1", //描述
            titleValue:1,//试题分值
            sort:1
        },
        jySjOptions1:[ //单选题内容
            {
                sort:1,//排序号
                optionName:"A",//选项名
                optionKey:"",//选项值
                isStandard:true,//是否为正确答案
            },
            {
                sort:2,//排序号
                optionName:"B",//选项名
                optionKey:"",//选项值
                isStandard:false,//是否为正确答案
            },
            {
                sort:3,//排序号
                optionName:"C",//选项名
                optionKey:"",//选项值
                isStandard:false,//是否为正确答案
            },
            {
                sort:4,//排序号
                optionName:"D",//选项名
                optionKey:"",//选项值
                isStandard:false,//是否为正确答案
            }
        ],
        jySjOptions2:[
            {
                sort:1,//排序号
                optionName:"A",//选项名
                optionKey:"",//选项值
                isStandard:true,//是否为正确答案
            },
            {
                sort:2,//排序号
                optionName:"B",//选项名
                optionKey:"",//选项值
                isStandard:true,//是否为正确答案
            },
            {
                sort:3,//排序号
                optionName:"C",//选项名
                optionKey:"",//选项值
                isStandard:true,//是否为正确答案
            },
            {
                sort:4,//排序号
                optionName:"D",//选项名
                optionKey:"",//选项值
                isStandard:true,//是否为正确答案
            }
        ],
        jySjOptions3:[{
            sort:1,//排序号
            optionName:"A",//选项名
            optionKey:"",//选项值
            isStandard:true,//是否为正确答案
        },],
        jySjOptions4:[
            {
                sort:1,//排序号
                optionName:"A",//选项名
                optionKey:"对",//选项值
                isStandard:true,//是否为正确答案
            },
            {
                sort:2,//排序号
                optionName:"B",//选项名
                optionKey:"错",//选项值
                isStandard:false,//是否为正确答案
            }
        ],
        jySjOptions5:"",
        jySjOptions6:"",
        jySjOptions7:"",
        stTitleId:"",
		sjlist:[],
        isPopWinShow:false,
    },
    updated:function(){
        var that = this;
        $("#st_type").unbind("change").change(function(){
            if ( that.jySjTitle.type == "1" )
                that.jySjTitle.title = "单选题";
            if ( that.jySjTitle.type == "2" )
                that.jySjTitle.title = "多选题";
            if ( that.jySjTitle.type == "3" )
                that.jySjTitle.title = "填空题";
            if ( that.jySjTitle.type == "4" )
                that.jySjTitle.title = "判断题";
            if ( that.jySjTitle.type == "5" ) {
                that.jySjTitle.title = "解答题";

            }
            if ( that.jySjTitle.type == "6" ) {
                that.jySjTitle.title = "改错题";

            }
            if ( that.jySjTitle.type == "7" ) {
                that.jySjTitle.title = "综合应用题";

            }

        });

        //修改选择项
        $(".st_key input[type=radio] ").unbind("change").change(function(){
            $(".nr_1 .st_da_true").text($(this).parent().parent().find(".optionName").val());
           // console.log($(this).parent().parent().find(".num").length);
            var i = parseInt($(this).parent().parent().find(".num").text(),10) - 1;
            //console.log(i,$(this).parent().parent().find(".num").text());
            vm.jySjOptions1.forEach(function(it,index){
                it.isStandard = false;
                Vue.set(vm.jySjOptions1, index,  it);
            })
            vm.jySjOptions1[i].isStandard = true;
            Vue.set(vm.jySjOptions1, i, vm.jySjOptions1[i]);
            //console.log(vm.jySjOptions1);
        });

        var zm = ['A','B','C','D','E','F','G','H','I','G',"K","L","M","N"]

        //保证执行一次
        $(".add_st_option").unbind("click").click(function(){
            vm.jySjOptions1.push({
                sort:vm.jySjOptions1.length,//排序号
                optionName:zm[vm.jySjOptions1.length],//选项名
                optionKey:"",//选项值
                isStandard:false,//是否为正确答案
            });
            //重新注册

        });

        $(".add_st_option2").unbind("click").click(function() {
            vm.jySjOptions2.push({
                sort: vm.jySjOptions2.length,//排序号
                optionName: zm[vm.jySjOptions2.length],//选项名
                optionKey: "",//选项值
                isStandard: true,//是否为正确答案
            });
            var keys = "";
            vm.jySjOptions2.forEach(function(it){
                if ( it.isStandard == true )
                    keys+= it.optionName;
            });
            $(".nr_2 .st_da_true").text(keys);
        });

        $(".add_st_option3").unbind("click").click(function() {
            vm.jySjOptions3.push({
                sort: vm.jySjOptions3.length,//排序号
                optionName: zm[vm.jySjOptions3.length],//选项名
                optionKey: "",//选项值
                isStandard: true,//是否为正确答案
            });
        });
        //多选题显示
        $(".nr_2 .st_key input[type=checkbox] ").unbind("change").change(function(){
            var i = parseInt($(this).parent().parent().find(".num").text(),10) - 1;
          //  alert(i,$(this).parent().parent().find(" .num").text()+"====");
            vm.jySjOptions2[i].isStandard = $(this).prop("checked");
            Vue.set(vm.jySjOptions2, i, vm.jySjOptions2[i]);
            var keys = "";
            vm.jySjOptions2.forEach(function(it){
                if ( it.isStandard == true )
                    keys+= it.optionName;
            });
            $(".nr_2 .st_da_true").text(keys);
        });

        $(".sjList").unbind("click").click(function(){
            $(this).parent().find(".active").removeClass("active");
            $(this).addClass("active")
        });


    },
    methods: {
        UpRow:function(it){
            var sort = parseInt(it.sort,10) - 1;
            alert(sort);
            sort = sort <= 0 ? 0:sort;

            var url =  "jysjtitle/update";
            $.ajax({
                type: "POST",
                url: baseURL + url,
                contentType: "application/json",
                data: JSON.stringify({id:it.id,sort:sort}),
                success: function (r) {
                    console.log(r);
                    if ( r.code == 0){
                        vm.getSJTitle(vm.jySjInfo.id);
                    }
                }
            });
        },
        DownRow:function(it){
            var sort = it.sort + 1;
            sort = sort < vm.sjtitleList.length ? sort:vm.sjtitleList.length - 1;

            var url =  "jysjtitle/update";
            $.ajax({
                type: "POST",
                url: baseURL + url,
                contentType: "application/json",
                data: JSON.stringify({id:it.id,sort:sort}),
                success: function (r) {
                    console.log(r);
                    if ( r.code == 0){
                        vm.getSJTitle(vm.jySjInfo.id);
                    }
                }
            });
        },
        delRow:function(it){
            var url =  "jysjtitle/delete";
            $.ajax({
                type: "POST",
                url: baseURL + url,
                contentType: "application/json",
                data: JSON.stringify([it.id]),
                success: function (r) {
                    console.log(r);
                    if ( r.code == 0){
                       vm.getSJTitle(vm.jySjInfo.id);
                    }
                }
            });
        },
        viewTm:function(){
            vm.isPopWinShow = true;
            vm.getSJTitle(vm.jySjInfo.id);
        },
        getStTile:function(){//取得当前试卷试题信息
            vm.stFsCont = 0;
            var url =  "jysjtitle/queryByParam";
            $.ajax({
                type: "POST",
                url: baseURL + url,
                // contentType: "application/json",
                 data: { infoId:vm.sjId,deleteState:0 },
                success: function (r) {
                    // console.log(r);
                    if ( r.code == 0){
                      // console.log(r);
                       var list = r.list;
                       vm.stCont = list.length;
                        vm.jySjTitle.sort = vm.stCont + 1;
                       list.forEach(function(it){
                           vm.stFsCont += it.titleValue //累加值
                       });
                    }
                }
            });
        },
        saveKsxx:function(){
            if ( $("#ksmc").val() == "" ){
                alert("考试名称不能为空！");
                return;
            }
            if ( $("#ECalendar_date_begin").val() == "" ){
                alert("考试时间不能为空！");
                return;
            }
            if ( $("#ECalendar_date_end").val() == "" ){
                alert("考试时间不能为空！");
                return;
            }
            if ( $("#examAheadTime").val() == "" ){
                alert("交卷时间不能为空！");
                return;
            }
            if ( vm.jySjInfo.kcId == "" ){
                alert("考试分类不能为空！");
                return;
            }

            var url =  "jysjinfo/update";
            vm.jySjInfo.examStartTime = $("#ECalendar_date_begin").val()+":00";
            vm.jySjInfo.examEndTime = $("#ECalendar_date_end").val()+":00";
            vm.jySjInfo.examAheadTime = $("#examAheadTime").val();
            $.ajax({
                type: "POST",
                url: baseURL + url,
                contentType: "application/json",
                data: JSON.stringify(vm.jySjInfo),
                success: function(r){

                    if(r.code === 0){
                       alert("考试信息发布成功！");
                        $("body *").prop("disabled",true);
                        vm.getSjxxList();
                    }else{
                        alert(r.msg);
                    }
                }
            });
        },
        getKcxx:function(){
            //取得课程信息
            var url =  "jykcxx/list";
            $.ajax({
                type: "POST",
                url: baseURL + url,
                contentType: "application/json",
                 data: JSON.stringify({deleteState:0,limit:300}),
                success: function (r) {
                    if ( r.code == 0){
                       vm.jyKcxxList =  r.page.list;

                    }
                }
            });
        },
        getContStslNum:function(){ //取得当前试卷的试题数量
            // //首选保存试题题目
            // var url =  "jysjtitle/save";
            // vm.jySjTitle.infoId = ;
            // $.ajax({
            //     type: "POST",
            //     url: baseURL + url,
            //     contentType: "application/json",
            //     data: JSON.stringify(vm.jySjTitle),
            //     success: function (r) {
            //
            //     }
            // });
        },
        getSJTitle:function(id){ //跟据ID取得试题内容
            var url = "jysjtitle/queryByParam"
            $.ajax({
                type: "POST",
                url: baseURL + url,
                // contentType: "application/json",
                data: {infoId:id,deleteState:0},
                success: function (r) {
                    // console.log(r);
                    vm.sjtitleList = r.list;
                }
            });
        },
        clearTitle:function(){
            vm.stTitleId = "";
            vm.jySjTitle = { //试题
                    infoId:"",
                    title:"单选题1",//题目
                    type:1,//类型
                    sjDescribe:"单选题1", //描述
                    titleValue:1,//试题分值
                    sort:1
            };
            vm.jySjOptions1 = [ //单选题内容
                {
                    sort:1,//排序号
                    optionName:"A",//选项名
                    optionKey:"",//选项值
                    isStandard:true,//是否为正确答案
                },
                {
                    sort:2,//排序号
                    optionName:"B",//选项名
                    optionKey:"",//选项值
                    isStandard:false,//是否为正确答案
                },
                {
                    sort:3,//排序号
                    optionName:"C",//选项名
                    optionKey:"",//选项值
                    isStandard:false,//是否为正确答案
                },
                {
                    sort:4,//排序号
                    optionName:"D",//选项名
                    optionKey:"",//选项值
                    isStandard:false,//是否为正确答案
                }
            ];
                vm.jySjOptions2 = [
                {
                    sort:1,//排序号
                    optionName:"A",//选项名
                    optionKey:"",//选项值
                    isStandard:true,//是否为正确答案
                },
                {
                    sort:2,//排序号
                    optionName:"B",//选项名
                    optionKey:"",//选项值
                    isStandard:true,//是否为正确答案
                },
                {
                    sort:3,//排序号
                    optionName:"C",//选项名
                    optionKey:"",//选项值
                    isStandard:true,//是否为正确答案
                },
                {
                    sort:4,//排序号
                    optionName:"D",//选项名
                    optionKey:"",//选项值
                    isStandard:true,//是否为正确答案
                }
            ]
            vm.jySjOptions3 = [
                {
                    sort:1,//排序号
                    optionName:"A",//选项名
                    optionKey:"",//选项值
                    isStandard:true,//是否为正确答案
                },
            ];

            vm.jySjOptions4 = [
                {
                    sort:1,//排序号
                    optionName:"A",//选项名
                    optionKey:"对",//选项值
                    isStandard:true,//是否为正确答案
                },
                {
                    sort:2,//排序号
                    optionName:"B",//选项名
                    optionKey:"错",//选项值
                    isStandard:false,//是否为正确答案
                }
            ];
            vm.jySjOptions5 = "";
            vm.jySjOptions6="";
            vm.jySjOptions7="";
        },
        saveSjtitle:function(){ //保存试题信息
            //验证
            function str2utf8(str) {
                encoder = new TextEncoder('utf8');
                return encoder.encode(str);
            }

            //首选保存试题题目
            var url =  "jysjtitle/save";
            vm.jySjTitle.infoId = vm.sjId;
            vm.jySjTitle.type = $("#st_type").val();
            vm.jySjTitle.sjDescribe = encodeURI(ue.getContent());

            ue.setContent("");
            $.ajax({
                type: "POST",
                url: baseURL + url,
                contentType: "application/json",
                data: JSON.stringify(vm.jySjTitle),
                success: function(r){
                   // console.log(r); //返回 id
                    vm.stTitleId = r.id;
                    if(r.code === 0){
                        //题目保存成功
                        //选项保存
                        if ( vm.jySjTitle.type == '1' ) { //选择题保存
                            //需要大批量的保存方法
                            var url =  "jysjoption/bathSave";
                            //给每一项写id
                            vm.jySjOptions1.forEach(function(it){
                                it.titleCode = vm.stTitleId;
                                it.isStandard = it.isStandard ? 1:0;
                            });

                            $.ajax({
                                    type: "POST",
                                    url: baseURL + url,
                                    contentType: "application/json",
                                    data: JSON.stringify(vm.jySjOptions1),
                                    success: function(r){
                                        if(r.code === 0){
                                            //alert(1);
                                            alert("单项选择保存成功!");
                                            //swiper.slideTo(2, 2000, false);//切换到第一个slide，速度为1秒
                                            vm.clearTitle();
                                            vm.getStTile();
                                        }else{
                                            alert(r.msg);
                                        }
                                    }
                            });
                        }
                        if ( vm.jySjTitle.type == '2' ) { //多选择题保存
                            //需要大批量的保存方法
                            var url =  "jysjoption/bathSave";
                            //给每一项写id
                            vm.jySjOptions2.forEach(function(it){
                                it.titleCode = vm.stTitleId;
                                it.isStandard = it.isStandard ? 1:0;
                            });

                            $.ajax({
                                type: "POST",
                                url: baseURL + url,
                                contentType: "application/json",
                                data: JSON.stringify(vm.jySjOptions2),
                                success: function(r){
                                    if(r.code === 0){
                                        //alert(1);
                                        alert("多项选择题保存成功!");
                                        //swiper.slideTo(2, 2000, false);//切换到第一个slide，速度为1秒
                                        vm.clearTitle();
                                        vm.getStTile();
                                    }else{
                                        alert(r.msg);
                                    }
                                }
                            });
                        }
                        if ( vm.jySjTitle.type == '3' ) { //填空题保存
                            //需要大批量的保存方法
                            var url =  "jysjoption/bathSave";
                            //给每一项写id
                            vm.jySjOptions3.forEach(function(it){
                                it.titleCode = vm.stTitleId;
                               it.isStandard = 1;
                            });

                            $.ajax({
                                type: "POST",
                                url: baseURL + url,
                                contentType: "application/json",
                                data: JSON.stringify(vm.jySjOptions3),
                                success: function(r){
                                    if(r.code === 0){
                                        //alert(1);
                                        alert("填空题保存成功");
                                        //swiper.slideTo(2, 2000, false);//切换到第一个slide，速度为1秒
                                        vm.clearTitle();
                                        vm.getStTile();
                                    }else{
                                        alert(r.msg);
                                    }
                                }
                            });
                        }
                        if ( vm.jySjTitle.type == '4' ) { //判断题保存
                            //需要大批量的保存方法
                            var url =  "jysjoption/bathSave";
                            //给每一项写id
                            vm.jySjOptions4.forEach(function(it){
                                it.titleCode = vm.stTitleId;
                                it.isStandard = 1;
                            });

                            $.ajax({
                                type: "POST",
                                url: baseURL + url,
                                contentType: "application/json",
                                data: JSON.stringify(vm.jySjOptions4),
                                success: function(r){
                                    if(r.code === 0){
                                        //alert(1);
                                        alert("判断题保存成功");
                                        //swiper.slideTo(2, 2000, false);//切换到第一个slide，速度为1秒
                                        vm.clearTitle();
                                        vm.getStTile();
                                    }else{
                                        alert(r.msg);
                                    }
                                }
                            });
                        }
                        if ( vm.jySjTitle.type == '5' ) { //解答题保存
                            //需要大批量的保存方法
                            var url =  "jysjoption/save";
                            $.ajax({
                                type: "POST",
                                url: baseURL + url,
                                contentType: "application/json",
                                data: JSON.stringify({
                                    titleCode: vm.stTitleId,
                                    isStandard:1,
                                    optionName:"",
                                    optionKey: encodeURI(ue1.getContent())
                                }),
                                success: function(r){
                                    if(r.code === 0){
                                        //alert(1);
                                        alert("解答题保存成功");
                                        //swiper.slideTo(2, 2000, false);//切换到第一个slide，速度为1秒
                                        vm.clearTitle();
                                        ue1.setContent("");
                                        vm.getStTile();
                                    }else{
                                        alert(r.msg);
                                    }
                                }
                            });
                        }
                        if ( vm.jySjTitle.type == '6' ) { //改错题保存
                            //需要大批量的保存方法
                            var url =  "jysjoption/save";
                            $.ajax({
                                type: "POST",
                                url: baseURL + url,
                                contentType: "application/json",
                                data: JSON.stringify({
                                    titleCode: vm.stTitleId,
                                    isStandard:1,
                                    optionName:"",
                                    optionKey: encodeURI(ue2.getContent())
                                }),
                                success: function(r){
                                    if(r.code === 0){
                                        //alert(1);
                                        alert("改错题保存成功");
                                        //swiper.slideTo(2, 2000, false);//切换到第一个slide，速度为1秒
                                        vm.clearTitle();
                                        ue2.setContent("");
                                        vm.getStTile();
                                    }else{
                                        alert(r.msg);
                                    }
                                }
                            });
                        }
                        if ( vm.jySjTitle.type == '7' ) { //综合应用题保存
                            //需要大批量的保存方法
                            var url =  "jysjoption/save";
                            var html = ue3.getContent();
                            console.log(html);
                            $.ajax({
                                type: "POST",
                                url: baseURL + url,
                                contentType: "application/json",
                                data: JSON.stringify({
                                    titleCode: vm.stTitleId,
                                    isStandard:1,
                                    optionName:"",
                                    optionKey:encodeURI(ue3.getContent())
                                }),
                                success: function(r){
                                    if(r.code === 0){
                                        //alert(1);
                                        alert("综合应用题保存成功");
                                        //swiper.slideTo(2, 2000, false);//切换到第一个slide，速度为1秒
                                        vm.clearTitle();
                                        ue3.setContent("");
                                        vm.getStTile();
                                    }else{
                                        alert(r.msg);
                                    }
                                }
                            });
                        }

                    }else{
                        alert(r.msg);
                    }
                }
            });

        },
        saveSjxx: function () {  //第一步生成试卷
            var url =  "jysjinfo/save";

            $.ajax({
                type: "POST",
                url: baseURL + url,
                contentType: "application/json",
                data: JSON.stringify(vm.jySjInfo),
                success: function(r){

                    if(r.code === 0){
                        vm.jySjInfo.id = vm.sjId = r.id; //保存试卷ID
                        swiper.slideTo(1, 2000, false);//切换到第一个slide，速度为1秒
						vm.getSjxxList();
                        vm.getStTile(); //取得试题信息
                    }else{
                        alert(r.msg);
                    }
                }
            });
        },
        copySjxx:function(){
            var url =  "jysjinfo/copySave";
            var id =  $(".sjList.active .vid").text();
            //alert(id);
            $.ajax({
                type: "POST",
                url: baseURL + url,
                contentType: "application/json",
                data: JSON.stringify({id:id}),
                success: function(r){

//                        console.log(r);
                    if(r.code === 0){

                        vm.getSjxxList();
                      //  vm.jySjInfo.id = vm.sjId = r.id; //保存试卷ID
                     //   swiper.slideTo(1, 2000, false);//切换到第一个slide，速度为1秒
                      //  vm.getSjxxList();
                     //   vm.getStTile(); //取得试题信息
                    }else{
                        alert(r.msg);
                    }
                }
            });

        },
        getSjxxList: function () {  //第一步生成试卷
            var url =  "jysjinfo/list";
			//alert(vm.sjmcQuery);
            $.ajax({
                type: "POST",
                url: baseURL + url,
                // contentType: "application/json;charset=utf-8",
                 data: {name:vm.sjmcQuery,deleteStatus:"0",limit:300},
                success: function(r){
                   // console.log(r);
                    if(r.code === 0){
                    	vm.sjlist = r.page.list;
						// console.log("============",vm.sjlist);
                      //  swiper.slideTo(1, 2000, false);//切换到第一个slide，速度为1秒
                    }else{
                        alert(r.msg);
                    }
                }
            });
        }
    }
});